package common.util;

public class Calculate {

	public static boolean isInBlastArea(int x0, int y0, int x, int y, int radius) {
		
		double i = 0;
		if(x <= x0 && y <= y0)
			i = Math.sqrt(Math.pow(x0 - x, 2) + Math.pow(y0 - y, 2));
		if(x > x0 && y > y0)
			i = Math.sqrt(Math.pow(x0 - ((x0 * 2) - x), 2) + Math.pow(y0 - ((y0 * 2) - y), 2));
		if(x > x0 && y <= y0)
			i = Math.sqrt(Math.pow(x0 - ((x0 * 2) - x), 2) + Math.pow(y0 - y, 2));
		if(x <= x0 && y > y0)
			i = Math.sqrt(Math.pow(x0 - x, 2) + Math.pow(y0 - ((y0 * 2) - y), 2));
		
		return i <= radius ? true : false;
	}

	
}
